﻿@model FILSTARTUPS_MOBILE.Models.RegistrationModel

@{
    ViewBag.Title = "Registration";
    Layout = "~/Views/Shared/_LayoutNonMember.cshtml";
}

<script type="text/javascript">

    $(document).ready(function () {
        var txt = $("#emailaddress");
        txt.keyup(function () {
            $.post("/Home/GetEmailAddress",
                {email: #(this).val()
            }, function (response){
                    $("#sample").html(response);
            });
        });
    });
</script>

<h2>Registration</h2>
<div id="sample"></div>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm("Registration","Home", FormMethod.Post ,new { @id ="register"}))
{
   if (TempData["message"] != null)
   {
        <div class="message error " id="tempdata">@TempData["message"]</div>
   }

    @Html.ValidationSummary(true)
    <fieldset>
    <div data-role="fieldcontain">
          <div class="editor-label">
            @Html.LabelFor(model => model.firstname)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.firstname, new { @placeholder = "Firstname" })
            @Html.ValidationMessageFor(model => model.firstname)
        </div>
    </div>
        
    <div data-role="fieldcontain">
          <div class="editor-label">
            @Html.LabelFor(model => model.lastname)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.lastname, new { placeholder = "Lastname" })
            @Html.ValidationMessageFor(model => model.lastname)
        </div>
    </div>

     <div data-role="fieldcontain">
        <div class="editor-label">
            @Html.LabelFor(model => model.emailaddress)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.emailaddress, new { @id = "emailaddress", @placeholder = "Email Address" });
            @Html.ValidationMessageFor(model => model.emailaddress)
        </div>
    </div>

    <div data-role="fieldcontain">
        <div class="editor-label">
            @Html.LabelFor(model => model.confirmemailaddress)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.confirmemailaddress, new { @placeholder = "Confirm Email Address" })
            @Html.ValidationMessageFor(model => model.confirmemailaddress)
        </div>
    </div>

    <div data-role="fieldcontain">
        <div class="editor-label">
            @Html.LabelFor(model => model.password)
        </div>
        <div class="editor-field" class="ui-hide-label">
            @Html.EditorFor(model => model.password, new { @placeholder = "Password" , @value= " "  })
            @Html.ValidationMessageFor(model => model.password)
        </div>
    </div>

    <div data-role="fieldcontain">
        <div class="editor-label">
            @Html.LabelFor(model => model.confirmpassword)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.confirmpassword, new { @placeholder = "Confirm Password" })
            @Html.ValidationMessageFor(model => model.confirmpassword)
        </div>
    </div>   

        <div data-role="fieldcontain">
        <div class="editor-label">
            @Html.LabelFor(model => model.secretquestion)
        </div>
        <div class="editor-field">
            <select id="secretquestion" name="secretquestion">
                <option value="What is the name of your favorite sports team?">What is the name of your favorite sports team?</option>
                <option value="What is the name of your favorite book?">What is the name of your favorite book?</option>
                <option value="What was your first pet's name?">What was your first pet's name?</option>
                <option value="What is the name of the street on which you grew up?">What is the name of the street on which you grew up?</option>
            </select>
            @Html.ValidationMessageFor(model => model.secretquestion)
        </div>
    </div>   
     
        <div data-role="fieldcontain">
        <div class="editor-label">
            @Html.LabelFor(model => model.secretanswer)
        </div>
        <div class="editor-field" class="ui-hide-label">
            @Html.EditorFor(model => model.secretanswer, new { @placeholder = "Password" , @value= " "  })
            @Html.ValidationMessageFor(model => model.secretanswer)
        </div>
    </div>

        <!--- CAPTCHA ---->
        <p>
            <div data-role="controlgroup" data-type="horizontal">
            <input type="submit" data-inline=true value="Register" />
            <a href="Index" data-role="button" >Cancel</a>
            </div>
        </p>
    </fieldset>
}

